<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui.css" />
	<link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui2.css" />
	<link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui3.css" />
	<link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/jquery-weui.min.css" />
	<link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/fabu.css" />
	<title>发布</title>
</head>

<body>
<div class="weui-header bg-orange">
	<div class="weui-header-left">
		<a class="icon icon-109 f-white" href="{:create_mobile_url("index")}">返回</a>
	</div>
	<h1 class="weui-header-title"></h1>

</div>
<form action="" method="post" enctype="multipart/form-data">

	<div class="page-bd weui_cell_switch">
		<ul>
			<li class="">
				<div class="weui-flex js-category">
					<p class="weui-flex-item" id="act1">信息分类
						<input name="xinxi" id="xinxi2" class="weui_input" value="{$xinxi}" type="text" readonly="">
					</p>
					<i class="icon icon-74"></i>
				</div>
				<div class="page-category js-categoryInner">
					<div class="weui_cells weui_cells_access" id="atvanniu" style="margin-top: 0px;">
						<!--<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default bg-orange-b">不限</a>-->
						<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">求购信息</a>
						<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">货品信息</a>
					</div>
				</div>
			</li>
			<li class="">
				<div class="weui-flex">
					<p class="weui-flex-item">货品分类
                        <input name="fenlei" class="weui_input" type="text" id="sss" value="{$goodsDefaultType}" readonly=""></p>
					<i class="icon icon-74"></i>
				</div>
			</li>
		</ul>
	</div>

	<div id="haha">
		<div class="weui_cells weui_cells_form">
			<div class="weui_cell">
				<div class="weui_cell_hd"><label class="weui_label">店名</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input name="dianming" class="weui_input" type="text"  placeholder="请输入店名" value="{$dianming}">
				</div>
			</div>
			<div class="weui_cell">
				<div class="weui_cell_hd"><label class="weui_label">手机号码</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input name="phone" class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入手机号码" value="{$phone}">
				</div>
			</div>
		</div>
		<div class="weui_cells weui_cells_form">
			<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary">
					<textarea name="describe" id="textarea" class="weui_textarea" placeholder="输入描述" rows="3">{$describe}</textarea>
					<div class="weui_textarea_counter"><span id="count">0</span>/<span id="count_max">500</span></div>
				</div>
			</div>
		</div>
		<div class="weui_cells weui_cells_form">
			<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary">
					<div class="weui_uploader">
						<div class="weui_uploader_bd">
							<ul class="weui_uploader_files" id="img2x">

							</ul>
							<div class="weui_uploader_input_wrp">
								<input name="pic[]" class="weui_uploader_input" type="file" accept="image/jpg,image/jpeg,image/png,image/gif" onchange="previewImage1(this)" multiple>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<input class="weui_btn weui_btn_warn fabu" type="submit" value="发布" />
    </div>
</form>
</div>
<script src="{$_G['addon_url']}/Public/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
<!--头部分类信息分类-->
<script type="text/javascript">
    $(function() {
        $('.js-category').click(function(e) {
            $parent = $(this).parent('li');
            if($parent.hasClass('js-show')) {
                $parent.removeClass('js-show');
                $(this).children('i').removeClass('icon-35').addClass('icon-74');
                e.stopPropagation();
            } else {
                $parent.siblings().removeClass('js-show');
                $parent.addClass('js-show');
                $(this).children('i').removeClass('icon-74').addClass('icon-35');
                $parent.siblings().find('i').removeClass('icon-35').addClass('icon-74');
                e.stopPropagation();
            }
        });
        $("#haha").click(function() {
            $nikk = $('.js-category').parent('li');
            $nikk.removeClass('js-show');
            if($nikk.hasClass('js-show')) {
                $('.js-category').children('i').removeClass('icon-35').addClass('icon-74');
            } else {
                $('.js-category').children('i').removeClass('icon-74').addClass('icon-35');
                $nikk.siblings().find('i').removeClass('icon-35').addClass('icon-74');
            }
        });
        $('.weui_cells_access').on('click', 'a', function() {
            $(this).addClass('bg-orange-b').siblings('a').removeClass('bg-orange-b');
            var txt = $(this).text();
            $('#xinxi2').val(txt);
            $('.js-show').removeClass('js-show');
        });

    });
</script>

<!--选择图片上传-->
<script src="{$_G['addon_url']}/Public/js/lrz.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    function previewImage1(file) {
        var MAXWIDTH = 100;
        var MAXHEIGHT = 200;
        for(var i = 0; i < file.files.length; i++) {

            if(file.files && file.files[i]) {
                var reader = new FileReader();
                reader.onload = function(evt) {
                    $('#img2x').append('<li class="weui_uploader_file weui_uploader_status" style="background-image:url(' + evt.target.result + ')"><div class="weui_uploader_status_content"><i class="icon icon-34"></i></div></li>');
                };
                reader.readAsDataURL(file.files[i]);
            }

        }

    }
</script>

<!--计算输入的字符长度-->
<script type="text/javascript">
    $(function() {
        $('#textarea').bind('input propertychange', function() {
            var cha = $('#textarea').val().length;
            $('#count').text(cha);
        });
        $('#img2x').on('click', '.weui_uploader_status_content', function() {
            $(this).parent('li').remove();
        });

    });




</script>
<script src="{$_G['addon_url']}/Public/js/picker.js" type="text/javascript" charset="utf-8"></script>
<script>
    + function(a) {
        a.rawCitiesData = [
            <foreach name="goodsTypeList" item="vo" key="k">
            {
                name: "{$k}",
                sub: [
                    <foreach name="vo" item="vo2" key="k2">
                        {
                            name: "{$vo2.type_name}"
                        },
                    </foreach>
                ]
            },
            </foreach>
        ]
    }($), + function(a) {
        "use strict";
        var b;
        a.fn.cityPicker = function(c) {
            return c = a.extend({}, b, c), this.each(function() {
                var o, p, q, b = function(a) {
                        var c, d, b = [];
                        for(c = 0; c < a.length; c++) d = a[c], "请选择" !== d.name && b.push(d.name);
                        return b.length ? b : [""]
                    },
                    d = function(a) {
                        return a.sub ? b(a.sub) : [""]
                    },
                    e = function(a) {
                        for(var b = 0; b < g.length; b++)
                            if(g[b].name === a) return d(g[b]);
                        return [""]
                    },
                    f = function(a, b) {
                        var c, e;
                        for(c = 0; c < g.length; c++)
                            if(g[c].name === a)
                                for(e = 0; e < g[c].sub.length; e++)
                                    if(g[c].sub[e].name === b) return d(g[c].sub[e]);
                        return [""]
                    },
                    g = a.rawCitiesData,
                    h = g.map(function(a) {
                        return a.name
                    }),
                    i = d(g[0]),
                    j = d(g[0].sub[0]),
                    k = h[0],
                    l = i[0],
                    m = j[0],
                    n = [{
                        values: h,
                        cssClass: "col-province"
                    }, {
                        values: i,
                        cssClass: "col-city"
                    }];
                c.showDistrict && n.push({
                    values: j,
                    cssClass: "col-district"
                }), o = {
                    cssClass: "city-picker",
                    rotateEffect: !1,
                    onChange: function(a) {
                        var h, i, j, g = a.cols[0].value;
                        return g !== k ? (i = e(g), h = i[0], j = f(g, h), a.cols[1].replaceValues(i), c.showDistrict && a.cols[2].replaceValues(j), k = g, l = h, a.updateValue(), void 0) : (c.showDistrict && (h = a.cols[1].value, h !== l && (a.cols[2].replaceValues(f(g, h)), l = h, a.updateValue())), void 0)
                    },
                    cols: n
                }, this && (p = a.extend(o, c), q = a(this).val(), q && (p.value = q.split(" "), p.value[0] && (k = p.value[0], p.cols[1].values = e(p.value[0])), p.value[1] ? (l = p.value[1], c.showDistrict && (p.cols[2].values = f(p.value[0], p.value[1]))) : (m = p.value[2], c.showDistrict && (p.cols[2].values = f(p.value[0], p.cols[1].values[0])))), a(this).picker(p))
            })
        }, b = a.fn.cityPicker.prototype.defaults = {
            showDistrict: !0
        }
    }($);
</script>
<script type="text/javascript">
    $(function() {
        $("#sss").cityPicker({
            title: "货品分类",
            showDistrict: false
        });
        $("#sss").on('click', function() {
            var html = '<div class="weui_mask weui_actions_mask weui_mask_visible"></div>';
            $('body').append(html);
        });
    });
</script>
<script>
    $(function () {
    	<if condition="isset($successInfo)">
            $.toast("{$successInfo}");
		</if>

        <if condition="isset($errorInfo)">
            $.toast("{$errorInfo}", "cancel");
    </if>
    });



</script>
</body>

</html>